package structure;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

import Util.StdOut;

public class BracketApp {

    public static void main(String[] args) {
        String input;
        while (true) {
            StdOut.printf("Enter string containing delimiters: ");
            System.out.flush();
            input = getString();
            if (input.equals("")) {
                break;
            }
            
            BracketChecker checker = new BracketChecker(input);
            checker.check();
        }
    }
    
    public static String getString() {
        InputStreamReader reader = new InputStreamReader(System.in);
        BufferedReader buffer = new BufferedReader(reader);
        try {
            return buffer.readLine();
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
            return "";
        }
    }
}
